/**
 *
 */
define(['fileinput', 'fileinput-zh', 'css!assets/bootstrap-fileinput-master/css/fileinput.min.css', 'platform.common'], function () {
    var ko = {};
    var platform = require('platform.common');
    ko.fileInput = function (uploadUri, options) {
        var self = this;
        self.defaults = {
            showUpload: false,//显示上传按钮
            autoReplace: true,//自动替换
            overwriteInitial: true,//重写初始化
            showUploadedThumbs: false,//显示上传图标
            showCaption: true,//显示特征
            showPreview: false,//显示预览
            uploadAsync: true,//异步上传
            uploadUrl: platform.mapUrl(uploadUri),
            language: "zh",
            enctype: 'multipart/form-data',
            allowedPreviewTypes: ['image', 'html', 'text', 'video', 'audio', 'flash', 'object'],//允许预览的文件类型
            allowedFileExtensions: ['jpg', 'gif', 'png', 'txt', 'xls', 'xlsx', 'doc', 'docx', 'pdf', 'rar'],//允许上传的文件类型
            maxFileCount: 1,//允许最大上传文件数量
            minFileCount: 1//允许最少文件上传梳理
        };

        self.params = $.extend({}, self.defaults, options || {});
    };
    return ko;
});